import { lazy } from 'react'
import {Navigate} from 'react-router-dom'


// 一级路由
var Index = lazy(()=>import('@/views/Index/Index.tsx'))
var NotFound = lazy(()=>import('@/views/NotFound/NotFound.tsx'))
var Assets =lazy(()=>import('@/views/Assets/Assets.tsx'))

// 二级路由
var SetUp = lazy(()=>import('@/views/Assets/SetUp/SetUp.tsx'))
var AssetManagement = lazy(()=>import('@/views/Assets/AssetManagement/AssetManagement.tsx'))
var InventoryManagement = lazy(()=>import('@/views/Assets/InventoryManagement/InventoryManagement.tsx'))

// 三级路由

// 资产管理
var List = lazy(()=>import('@/views/Assets/AssetManagement/List/List.tsx'))
var Kind = lazy(()=>import('@/views/Assets/AssetManagement/Kind/Kind.tsx'))
var AssetInventory = lazy(()=>import('@/views/Assets/AssetManagement/AssetInventory/AssetInventory.tsx'))
var Manage = lazy(()=>import('@/views/Assets/AssetManagement/Manage/Manage.tsx'))
// 库存管理
var PurchaseOrder = lazy(()=>import('@/views/Assets/InventoryManagement/PurchaseOrder/PurchaseOrder.tsx'))

// 路由
 // 新增资产
var AddThing = lazy(()=>import('@/views/Assets/AssetManagement/List/AddThing/AddThing.tsx'))
// 新增盘点
var AddInventory = lazy(()=>import('@/views/Assets/AssetManagement/AssetInventory/AddInventory/AddInventory.tsx'))

// 设置新增表单
// var MyForm = lazy(()=>import('@/views/Assets/SetUp/MyForm/MyForm.tsx'))

// 借用

var Borrow = lazy(()=>import('@/views/Assets/InventoryManagement/Borrow/Borrow.tsx'))



export default [
    {
        path:'/index/assets',
        element:  <Assets />,
        children:[
            // 设置
            {
                path:'/index/assets/setup',
                element:  <SetUp />,
                // children:[
                //     {
                //         path:'/index/assets/setup/myform',
                //         element:  <MyForm />,
                //     }
                // ]
            },
            // 资产管理
            {
                path:'/index/assets/assetmanagement',
                element:  <AssetManagement />,
                children:[
                    // 资产列表
                    {
                        path:'/index/assets/assetmanagement/list',
                       element:  <List />,
                    },
                    // 新增资产
                    {
                        path:'/index/assets/assetmanagement/list/addthing',
                        element:  <AddThing />,
                    },
                    //  资产类别
                    {
                        path:'/index/assets/assetmanagement/kind',
                       element:  <Kind />,
                    },
                    // 仓库管理
                    {
                        path:'/index/assets/assetmanagement/manage',
                       element:  <Manage />,
                    },
                    // 资产盘点
                    {
                        path:'/index/assets/assetmanagement/assetInventory',
                       element:  <AssetInventory />,
                    },
                    // 新增盘点
                    {
                        path:'/index/assets/assetmanagement/assetInventory/addinventory',
                       element:  <AddInventory />,
                    },

                    {
                        path:'/index/assets/assetmanagement',
                        element: <Navigate to="/index/assets/assetmanagement/list" />
                    },
                   
                ]
            },
            // 库存管理
            {
                path:'/index/assets/inventorymanagement',
                element:  <InventoryManagement />,
                children:[
                    // 采购单
                    {
                        path:'/index/assets/inventorymanagement/purchaseorder',
                        element:  <PurchaseOrder />,
                    },
                    // 借用
                    {
                        path:'/index/assets/inventorymanagement/borrow',
                        element:  <Borrow />,
                    },
                ]
            },
            {
                path:'/index/assets',
                element: <Navigate to="/index/assets/assetmanagement" />
            },
            {
                path:'*',
                element: <NotFound />
            }
        ]
    },
]



